<div class="modal-dialog">
	<div class="modal-content">
		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal">&times;</button>
			<h4 class="modal-title">Preview Kuesioner</h4>
		</div>
		<div class="modal-body">
				<div class="container-fluid">
					<div>
					<h3 align="center"><?php echo $kuesioner[0]['nama_kuesioner'];?></h3>
					<h4 align="center"><?php echo $kuesioner[0]['deskripsi'];?></h4>
					</div>
					<div class="form-group" style="margin-left:110px">
					<table class="table">
						<?php
						$nomor = 1;
						$skala = array();
						foreach($konten as $konten)
						{
							if($konten['jenis_pertanyaan'] == 'teks')
							{	
								echo '<tr>';
								echo '<td>'.$nomor++.'</td>';
								echo '<td>'.$konten['pertanyaan'].'</td>';
								echo '<td>:</td>';
								echo '<td><input name="id_pertanyaan[]" value="'.$konten['id_pertanyaan'].'" hidden></td>';
								echo '<td colspan="7"><input class="form-control" name="jawab[]"></td>';
								echo '</tr>';
							} else
								{
									if($konten['jenis_pertanyaan'] == 'skala')
									{
										if(empty($skala)){
											echo '<tr>';
											echo '<td></td>';
											echo '<td></td>';
											echo '<td></td>';
											echo '<td></td>';
											$skala = explode(',', $konten['skala']);
											//var_dump($skala);
											for($i = 0; $i < count($skala)-1; $i++)
											{
												echo '<td >'.$skala[$i].'</td>';
											}
											echo '</tr>';
											echo '<tr>';
												echo '<td>'.$nomor++.'</td>';
												echo '<td  colspan="2">'.$konten['pertanyaan'].'</td>';
												echo '<td ><input name="id_pertanyaan[]" value="'.$konten['id_pertanyaan'].'" hidden></td>';
												for($i = 0; $i < count($skala)-1; $i++)
												{
													$cekbox = $i+1;
													echo '<td ><input type="checkbox" name="jawab[]" id="checkbox'.$nomor.'" value="'.$cekbox.'"></td>';
												}
												echo '</tr>';
										} else
											{
												echo '<tr>';
												echo '<td>'.$nomor++.'</td>';
												echo '<td colspan="2">'.$konten['pertanyaan'].'</td>';
												echo '<td ><input name="id_pertanyaan[]" value="'.$konten['id_pertanyaan'].'" hidden></td>';
												for($i = 0; $i < count($skala)-1; $i++)
												{
													$cekbox = $i+1;
													echo '<td ><input type="checkbox" name="jawab[]" id="checkbox'.$nomor.'" value="'.$cekbox.'"></td>';
												}
												echo '</tr>';
											}
									}
								}
							
							
						}
						?>
					</table>
					</div>			
				</div>
			</div>
	</div>
</div>
		
		
<script>
		$("input:checkbox").change(function(){
		 var groupcekbox = ":checkbox[id='"+ $(this).attr("id") + "']";
		   if($(this).is(':checked')){
			 $(groupcekbox).not($(this)).attr("checked",false);
		   }
		 });
</script>